using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;
namespace JQueryControlToolkit.Controls
{
	[DefaultProperty("Chaining"), ParseChildren(true, "Chaining"), PersistChildren(false)]
	public class Animation : JQueryAction, IAnimation, JSObject
	{
		protected override string jQueryFunction
		{
			get
			{
				return "animate";
			}
		}
		public string Style
		{
			get;
			set;
		}
		public int Duration
		{
			get;
			set;
		}
		public string Easing
		{
			get;
			set;
		}
		[PersistenceMode(PersistenceMode.InnerDefaultProperty)]
		public Container<JQueryAction> Chaining
		{
			get;
			set;
		}
		public Animation()
		{
			this.Chaining = new Container<JQueryAction>();
			this.Duration = 500;
			this.Easing = "linear";
		}
		protected override Dictionary<string, object> EvaluateParameters(Dictionary<string, object> properties)
		{
			List<object> unNamedParameters = new List<object>();
			unNamedParameters.Add(new CssOptions(this.Style, this.Page));
			unNamedParameters.Add(this.Duration);
			unNamedParameters.Add(DomResult.Escape(this.Easing));
			if (this.Chaining.Elements.Count > 0)
			{
				unNamedParameters.Add(new JSFunction(this.Chaining.Elements.ToArray()));
			}
			return new Dictionary<string, object>
			{

				{
					"",
					unNamedParameters
				}
			};
		}
	}
}
